import { RouteRecordRaw } from "vue-router";
import HomeView from "../views/HomeView.vue";
import LoginView from "@/views/LoginView.vue";
import ACCESS_ENUM from "@/access/accessEnum";
import LoginLayout from "@/layouts/LoginLayout.vue";
import UserLayout from "@/layouts/UserLayout.vue";
import studentProfile from "@/views/student/StudentProfile.vue";
import teacherProfile from "@/views/teacher/TeacherProfile.vue";
import NoAuthView from "@/views/NoAuthView.vue";
import JobProvided from "@/views/student/JobProvided.vue";
import StudentManage from "@/views/student/StudentManage.vue";
import teaJobProvided from "@/views/teacher/teaJobProvided.vue";
import NewUserLayout from "@/layouts/NewUserLayout.vue";
import CheckJobView from "@/views/admin/checkJobView.vue";
import ApplyJobView from "@/views/teacher/applyJobView.vue";
import AddJobView from "@/views/teacher/addJobView.vue";
import StudentResume from "@/views/student/StudentResume.vue";

export const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    component: HomeView,
    name: "这是首页",
    meta: {
      invisible: true,
      access: ACCESS_ENUM.LOGIN,
    },
  },
  {
    path: "/user",
    meta: {
      invisible: true,
    },
    name: "登录",
    component: LoginLayout,
    children: [
      {
        path: "/user/login",
        name: "用户登录",
        component: LoginView,
        meta: {
          access: ACCESS_ENUM.NOT_LOGIN,
        },
      },
    ],
  },
  {
    path: "/profile",
    name: "用户",
    component: NewUserLayout,
    meta: {
      invisible: true,
    },
    children: [
      {
        path: "/profile/index",
        name: "首页",
        component: HomeView,
      },
      {
        path: "/profile/student",
        name: "个人资料",
        component: studentProfile,
        meta: {
          access: ACCESS_ENUM.STUDENT,
        },
      },
      {
        path: "/profile/jobProvided",
        name: "岗位信息",
        component: JobProvided,
        meta: {
          access: ACCESS_ENUM.STUDENT,
        },
      },
      {
        path: "/profile/resume",
        name: "个人简历",
        component: StudentResume,
        meta: {
          access: ACCESS_ENUM.STUDENT,
        },
      },
      {
        path: "/profile/studentManage",
        name: "学生管理",
        component: StudentManage,
        meta: {
          access: ACCESS_ENUM.STUDENT,
        },
      },
      {
        path: "/profile/studentShow",
        name: "学生信息展示",
        component: teacherProfile,
        meta: {
          access: ACCESS_ENUM.TEACHER,
        },
      },
      {
        path: "/profile/teaJobProvided",
        name: "教师岗位提供",
        component: teaJobProvided,
        meta: {
          access: ACCESS_ENUM.TEACHER,
        },
      },
      {
        path: "/profile/addJob",
        name: "添加岗位",
        component: AddJobView,
        meta: {
          access: ACCESS_ENUM.TEACHER,
        },
      },
      {
        path: "/profile/apply",
        name: "学生就业",
        component: ApplyJobView,
        meta: {
          access: ACCESS_ENUM.TEACHER,
        },
      },
      {
        path: "/profile/check",
        name: "就业审核",
        component: CheckJobView,
        meta: {
          access: ACCESS_ENUM.ADMIN,
        },
      },
    ],
  },
  {
    path: "/noAuth",
    meta: {
      invisible: true,
    },
    name: "无权限",
    component: NoAuthView,
  },
];
